Repository navigation
Conversation
Build compact point lists, reuse common weight values, and check equal-length rows for NaNs in place. Co-Authored-By: Aiden <aiden@weco.ai>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
What & Why
The constructor built lists with spare room and copied the full dataset into a NumPy array to check for NaNs.
It now joins the validated coordinates and weights into one list per point and scans equal-length rows in place.
A small dictionary keeps up to 256 converted weights for reuse. Each point still gets its own list, and negative zero keeps its sign.
Validation
The memory tests used weighted NumPy arrays on Python 3.12 with 101 different weights. A separate timing test used unique random weights.
The large survey gave these results across five row orders.
With default thread settings and tracing off, median wall time was 667 ms before and 659 ms after (new/old 0.988, seven calls each).
To measure peak memory from either checkout, run:
The native tests ran with this command and reported one pytest deprecation warning.
python -m pip install --no-cache-dir -r requirements.txt pytest pandas && python -B -m pytest -p no:cacheprovider tests/plugins/test_heat_map.py tests/plugins/test_fast_marker_cluster.py tests/plugins/test_marker_cluster.py tests/test_utilities.py -qWhy this is safe and easy to maintain
The constructor keeps the same output and uses the existing coordinate validator. NumPy still reports inconsistent row lengths.
Tests in
test_heat_map.pycover rendering and coordinate bounds. Separate checks covered row order, independent lists, numeric types, warnings, and errors for invalid inputs.AI assistance
This PR was prepared with AI assistance from Aiden. Candidates were tracked with Weco Observe.
Weco share link: https://dashboard.weco.ai/share/PeiGnOxZPFCx4S_2249l_JmuNDCvDWyM